package com.wdemo.pojo.vo;

import org.springframework.ai.chat.messages.Message;

/**
 * @ClassName MessageVo
 * @Description 消息VO类
 * @Author WDEMO
 * @Date 2025/8/20 22:19
 */
public class MessageVo {
    /**
     * 消息角色
     */
    private String role;

    /**
     * 消息内容
     */

    private String content;

    public MessageVo(Message message) {
        switch (message.getMessageType()) {
            case USER:
                role = "user";
                break;
            case ASSISTANT:
                role = "assistant";
                break;
            default:
                break;
        }
        this.content = message.getText();
    }


    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }
}
